<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script src="/common/js/jquery-3.2.1.js"></script>
    <title>登录</title>
    <script>
        function login(){
           var username=document.getElementById("username");
           var password=document.getElementById("password");
           $.ajax({
               url:"/logincheck",
               type:"post",
               data:{"username":username.value,"password":password.value},
               success:function (str){
                   if(str==="ok"){
                       window.location="/admin/index";
                   }else{
                       alert(str);
                   }
               }
           })
        }
    </script>
</head>
<body>
<div style="text-align: center;margin-top: 100px;">
    <h1>用户登录</h1>
    <form>
        用户名: <input type="text" id="username"><br><br>
        密&nbsp;码: <input type="password" id="password"><br><br>
        <input onclick="login()" type="button" value="登录" style="width: 150px;height:40px;background: black;color:#ffffff">
    </form>
</div>
</body>
</html>